#!/usr/bin/python3.8
# -*- coding: utf-8 -*-
# @Time    : 2021/3/11 8:34 下午
# @Author  : zhaohexin
# @Email   : 1483643520@xxx.com
# @File    : schemas.py
# @Software: PyCharm
# @FileDescription： 菜单校验

from typing import Optional
from pydantic import BaseModel

from common.BaseSchemas import BaseSchemas


class Menus(BaseSchemas):
    """
    通用校验
    """
    pid: Optional[int] = None
    sub_count: Optional[int] = None
    type: Optional[int] = None
    title: Optional[str] = None
    name: Optional[str] = None
    component: Optional[str] = None
    sort: Optional[int] = None
    icon: Optional[str] = None
    path: Optional[str] = None
    i_frame: Optional[bool] = False
    cache: Optional[bool] = False
    hidden: Optional[bool] = False
    permission: Optional[str] = None


class MenusWeb(BaseModel):
    """
    返回前端数据
    """
    cache: Optional[bool] = False
    hasChildren: bool
    hidden: bool
    iFrame: bool
    icon: Optional[str] = None
    label: Optional[str] = None
    leaf: bool
    menuSort: int
    title: Optional[str] = None
    type: int
    id: int
    createTime: str
    updateTime: str
    createBy: str

